-
Couldn't load subscription status.
- Fork 3.4k
Asim GitHub workflow pipeline #12973
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
This reverts commit 2580ab5.
Introduces a security approval job to require a 'safe to test' label for forked pull requests before running ASIM Schema and Data testers. The workflow checks for race conditions (commits after label approval) and provides automated guidance comments for maintainers. Also updates trigger to use pull_request_target, adds concurrency control.
| jobs: | ||
| # Security gate: Fork PRs require manual approval via "safe to test" label | ||
| # Internal PRs (same repo) can proceed without labels | ||
| security-gate: | ||
| name: Security approval gate for fork PRs | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 5 | ||
| permissions: |
Check failure
Code scanning / CodeQL
Checkout of untrusted code in trusted context High
pull_request_target
Update the workflow to use the most recent 'safe to test' label event by switching from 'head -1' to 'tail -1' when parsing the timeline. Also remove an unnecessary exit statement in the manual approval branch.
| }); | ||
| // Check if we already have a guidance comment to avoid spam | ||
| const existingComment = comments.find(comment => | ||
| comment.body.includes('🔒 **Security Approval Required**') && | ||
| comment.user.type === 'Bot' | ||
| ); | ||
| let commentBody = ''; | ||
| // Check what type of approval is needed based on the step outputs | ||
| if ('${{ steps.check-approval.outputs.needs_reapproval }}' === 'true') { | ||
| commentBody = `🔒 **Security Re-approval Required** | ||
| ⚠️ **Race condition detected**: New commits were pushed after the \`safe to test\` label was added. | ||
| **For security, a maintainer must:** | ||
| 1. 📝 Review the latest commits carefully for any security concerns | ||
| 2. 🏷️ Remove the \`safe to test\` label | ||
| 3. 🏷️ Re-add the \`safe to test\` label if the new commits are safe | ||
| This ensures that all commits have been properly reviewed before testing with repository secrets. | ||
| --- | ||
| *This is an automated security check to prevent malicious code execution. Learn more about [GitHub Security Lab recommendations](https://securitylab.github.com/resources/github-actions-preventing-pwn-requests/).*`; | ||
| } else { | ||
| commentBody = `🔒 **Security Approval Required** |
Check failure
Code scanning / CodeQL
Checkout of untrusted code in a privileged context Critical
pull_request_target
| 1. 📝 Review the code changes carefully | ||
| 2. 🏷️ Add the \`safe to test\` label if the changes are safe to execute | ||
| This protects against malicious code execution in fork contributions. | ||
| --- | ||
| *This is an automated security check to prevent malicious code execution. Learn more about [GitHub Security Lab recommendations](https://securitylab.github.com/resources/github-actions-preventing-pwn-requests/).*`; | ||
| } |
Check failure
Code scanning / CodeQL
Checkout of untrusted code in trusted context High
pull_request_target
Replaces use of repo.pushed_at with the actual PR head commit timestamp by fetching commit details via the GitHub API. Adds additional debug logging to the comment step for better traceability and updates log messages for comment creation and updates.
Update workflow to always create a new security guidance comment instead of updating or deleting previous ones. This preserves the audit trail by keeping all past comments for reference.
Required items, please complete
Change(s):
Reason for Change(s):
Version Updated:
Testing Completed:
Checked that the validations are passing and have addressed any issues that are present: